﻿using System.Configuration;

namespace FileDistributor.Configuration
{
    public static class ConfigurationHelper
    {
        public static FileDistributorSection GetDistributorSection()
        {
            var configSection = (FileDistributorSection)ConfigurationManager.GetSection("fileDistributor");
            
            if (configSection == null)
            {
                throw new ConfigurationErrorsException("Failed to load ConfigurationSection \" fileDistributor \". Verify that it is properly declared in the configurationfile.");
            }

            return configSection;
        }
    }
}
